package com.peanut.youfupay.service.other.charge;


import com.alibaba.fastjson.JSON;
import com.peanut.youfupay.entity.request.QueryChargeRecordDTO;
import com.peanut.youfupay.entity.response.QueryChargeRecordResponseDTO;
import com.peanut.youfupay.entity.response.ResponseMessage;
import com.peanut.youfupay.enums.FunCodeEnum;
import com.peanut.youfupay.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


/**
 * 商户查询充值结果
 *
 * @author peanut
 */
@Slf4j
@Service("queryChargeRecordService")
public class QueryChargeRecordService extends BaseService {
    /**
     * @param funCodeEnum
     * @param queryChargeRecordDTO
     * @return
     * @throws Exception
     */
    public QueryChargeRecordResponseDTO doBusiness(FunCodeEnum funCodeEnum, QueryChargeRecordDTO queryChargeRecordDTO) throws Exception {
        log.info("查询充值结果开始:{}，{}", funCodeEnum, queryChargeRecordDTO);
        ResponseMessage responseMessage = applyYouFuByHttpPost(funCodeEnum, queryChargeRecordDTO);
        QueryChargeRecordResponseDTO queryChargeRecordResponseDTO = JSON.parseObject(responseMessage.getResData(), QueryChargeRecordResponseDTO.class);
        log.info("查询充值结果结束:{}", queryChargeRecordResponseDTO);
        return queryChargeRecordResponseDTO;
    }
}





